Optimal. Leaf size=39 \[ \frac {b c x}{2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )-\frac {1}{2} b c^2 \tanh ^{-1}\left (\frac {x}{c}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.01, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {6037, 199, 327,
213} \begin {gather*} \frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )-\frac {1}{2} b c^2 \tanh ^{-1}\left (\frac {x}{c}\right )+\frac {b c x}{2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 199
Rule 213
Rule 327
Rule 6037
Rubi steps
\begin {align*} \int x \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right ) \, dx &=\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )+\frac {1}{2} (b c) \int \frac {1}{1-\frac {c^2}{x^2}} \, dx\\ &=\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )+\frac {1}{2} (b c) \int \frac {x^2}{-c^2+x^2} \, dx\\ &=\frac {b c x}{2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )+\frac {1}{2} \left (b c^3\right ) \int \frac {1}{-c^2+x^2} \, dx\\ &=\frac {b c x}{2}+\frac {1}{2} x^2 \left (a+b \tanh ^{-1}\left (\frac {c}{x}\right )\right )-\frac {1}{2} b c^2 \tanh ^{-1}\left (\frac {x}{c}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 56, normalized size = 1.44 \begin {gather*} \frac {b c x}{2}+\frac {a x^2}{2}+\frac {1}{2} b x^2 \tanh ^{-1}\left (\frac {c}{x}\right )+\frac {1}{4} b c^2 \log (-c+x)-\frac {1}{4} b c^2 \log (c+x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 60, normalized size = 1.54
method | result | size |
derivativedivides | \(-c^{2} \left (-\frac {a \,x^{2}}{2 c^{2}}-\frac {b \,x^{2} \arctanh \left (\frac {c}{x}\right )}{2 c^{2}}+\frac {b \ln \left (1+\frac {c}{x}\right )}{4}-\frac {b \ln \left (\frac {c}{x}-1\right )}{4}-\frac {b x}{2 c}\right )\) | \(60\) |
default | \(-c^{2} \left (-\frac {a \,x^{2}}{2 c^{2}}-\frac {b \,x^{2} \arctanh \left (\frac {c}{x}\right )}{2 c^{2}}+\frac {b \ln \left (1+\frac {c}{x}\right )}{4}-\frac {b \ln \left (\frac {c}{x}-1\right )}{4}-\frac {b x}{2 c}\right )\) | \(60\) |
risch | \(\frac {b \,x^{2} \ln \left (x +c \right )}{4}-\frac {b \,x^{2} \ln \left (c -x \right )}{4}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (x +c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{3}}{8}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (i \left (x +c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{2}}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{3}}{8}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (x +c \right )}{x}\right )^{2}}{8}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2}}{4}-\frac {i \pi b \,x^{2}}{4}+\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (i \left (c -x \right )\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2}}{8}-\frac {i \pi b \,x^{2} \mathrm {csgn}\left (i \left (c -x \right )\right ) \mathrm {csgn}\left (\frac {i \left (c -x \right )}{x}\right )^{2}}{8}+\frac {a \,x^{2}}{2}+\frac {b c x}{2}+\frac {b \,c^{2} \ln \left (x -c \right )}{4}-\frac {b \,c^{2} \ln \left (x +c \right )}{4}\) | \(311\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.25, size = 44, normalized size = 1.13 \begin {gather*} \frac {1}{2} \, a x^{2} + \frac {1}{4} \, {\left (2 \, x^{2} \operatorname {artanh}\left (\frac {c}{x}\right ) - {\left (c \log \left (c + x\right ) - c \log \left (-c + x\right ) - 2 \, x\right )} c\right )} b \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 39, normalized size = 1.00 \begin {gather*} \frac {1}{2} \, b c x + \frac {1}{2} \, a x^{2} - \frac {1}{4} \, {\left (b c^{2} - b x^{2}\right )} \log \left (-\frac {c + x}{c - x}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.12, size = 36, normalized size = 0.92 \begin {gather*} \frac {a x^{2}}{2} - \frac {b c^{2} \operatorname {atanh}{\left (\frac {c}{x} \right )}}{2} + \frac {b c x}{2} + \frac {b x^{2} \operatorname {atanh}{\left (\frac {c}{x} \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 130 vs.
\(2 (33) = 66\).
time = 0.40, size = 130, normalized size = 3.33 \begin {gather*} -\frac {\frac {b {\left (c + x\right )} c^{3} \log \left (-\frac {c + x}{c - x}\right )}{{\left (c - x\right )} {\left (\frac {{\left (c + x\right )}^{2}}{{\left (c - x\right )}^{2}} + \frac {2 \, {\left (c + x\right )}}{c - x} + 1\right )}} + \frac {b c^{3} + \frac {2 \, a {\left (c + x\right )} c^{3}}{c - x} + \frac {b {\left (c + x\right )} c^{3}}{c - x}}{\frac {{\left (c + x\right )}^{2}}{{\left (c - x\right )}^{2}} + \frac {2 \, {\left (c + x\right )}}{c - x} + 1}}{c} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.74, size = 36, normalized size = 0.92 \begin {gather*} \frac {a\,x^2}{2}-\frac {b\,c^2\,\mathrm {atanh}\left (\frac {c}{x}\right )}{2}+\frac {b\,x^2\,\mathrm {atanh}\left (\frac {c}{x}\right )}{2}+\frac {b\,c\,x}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________